package com.stylefeng.guns.rest.modular.App.controller;

import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.rest.Tools.CodeMsg;
import com.stylefeng.guns.rest.Tools.Result;
import com.stylefeng.guns.rest.modular.App.model.OrderNoteDict;
import com.stylefeng.guns.rest.modular.App.service.IOrderNoteDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 订单备注字典
 *
 * @author sasazaixian
 * @Date 2018-12-25 10:44
 */
@Controller
@RequestMapping(value = {"/gunsApi/auth/orderNoteDict"})
@Api(value = "订单备注字典操作相关api", tags = {"订单备注字典操作接口"})
public class OrderNoteDictController extends BaseController {
    @Autowired
    private IOrderNoteDictService orderNoteDictService;
	

    /**
     * 获取订单备注字典列表
     * @return	
     */
    @ApiOperation(value = "获取订单备注字典列表", notes = "获取订单备注字典列表", httpMethod = "GET")
    @GetMapping(value = "/list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    public Result list() {
        try {
            OrderNoteDict orderNoteDict=new OrderNoteDict ();
            orderNoteDict.setOndIsAlived("1");
            return Result.success( orderNoteDictService.selectListOrderNoteDict(orderNoteDict,null));
        }catch(Exception e){
            return Result.error(e.getMessage(),500100);
        }
    }
	private String getToken(){		
		return getHttpServletRequest().getHeader("Authorization").substring(7);
    }
}
